package org.qloudgen.txn.dilithium.cluster.pages;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.model.Model;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.util.time.Duration;

import org.qloudgen.txn.dilithium.cluster.pages.common.BasePage;

@SuppressWarnings("unchecked")
public class ShowLogPage extends BasePage{

	/**
	 * @Author youngeryoyo
	 * youngeryoyo@gmail.com
	 */

	private static final long serialVersionUID = 1L;
	private boolean flag = true;
	
	@SuppressWarnings({ "rawtypes" })
	public ShowLogPage(PageParameters pageParameters){
		
		super();
		this.pp = pageParameters;

		final TextArea logInfo = new TextArea("logInfo");
		logInfo.setEnabled(true);
		final StringBuffer sb = (StringBuffer) getSession().getAttribute("logInfo");
		logInfo.setDefaultModel(new Model(sb));
		logInfo.setOutputMarkupId(true);
		
		final AjaxSelfUpdatingTimerBehavior ajaxSUTBehavior = new AjaxSelfUpdatingTimerBehavior(Duration.seconds(1));
		logInfo.add(ajaxSUTBehavior);

		this.add(logInfo);
		
		addHeader();
		
		addReturnPage(ClusterMainPage.class,pp);
		
		addFooter();
	}
}
